#include "stdio.h"

/* implementation of library function gets() */
char *my_gets(char *s) {
  int c;
  char *dest = s;
  while ((c = getchar()) != '\n' && c != EOF)
    *dest++ = c;
  if (c == EOF && dest == s)
    /* No characters read */
    return NULL;
  *dest++ = '\0'; /* Terminate string */
  return s;
}

/* Read input line and write it back */
void echo() {
  char buf[8];
  my_gets(buf);
  puts(buf);
  /* Way too small! */
}

// int main() { echo(); }

/*gcc -O2 -S s10.gets-echo.c*/